package com.ruoyi.feiyi.service.impl;

import java.util.Arrays;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.feiyi.mapper.FyFeedbackMapper;
import com.ruoyi.feiyi.domain.FyFeedback;
import com.ruoyi.feiyi.service.IFyFeedbackService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户反馈Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-26
 */
@Service
public class FyFeedbackServiceImpl extends ServiceImpl<FyFeedbackMapper, FyFeedback> implements IFyFeedbackService
{

    /**
     * 查询用户反馈
     * 
     * @param id 用户反馈主键
     * @return 用户反馈
     */
    @Override
    public FyFeedback getInfoById(Long id)
    {
        return this.getById(id);
    }

    /**
     * 查询用户反馈列表
     * 
     * @param fyFeedback 用户反馈
     * @return 用户反馈
     */
    @Override
    public List<FyFeedback> selectList(FyFeedback fyFeedback)
    {
        return baseMapper.selectList(fyFeedback);
    }

    /**
     * 新增用户反馈
     * 
     * @param vo
     * @return 结果
     */
    @Override
    public int insertFyFeedback(FyFeedback vo)
    {
        vo.setCreateTime(DateUtils.getNowDate());
        this.save(vo);
        return 1;
    }

    /**
     * 修改用户反馈
     * 
     * @param fyFeedback 用户反馈
     * @return 结果
     */
    @Override
    public int updateFyFeedback(FyFeedback fyFeedback)
    {
        fyFeedback.setUpdateTime(DateUtils.getNowDate());
        this.updateById(fyFeedback);
        return 1;
    }

    /**
     * 批量删除用户反馈
     * 
     * @param ids 需要删除的用户反馈主键
     * @return 结果
     */
    @Override
    public int deleteFyFeedbackByIds(String ids)
    {
        this.removeByIds(Arrays.asList(Convert.toStrArray(ids)));
        return 1;
    }

    /**
     * 删除用户反馈信息
     * 
     * @param id 用户反馈主键
     * @return 结果
     */
    @Override
    public int deleteFyFeedbackById(Long id)
    {
        this.removeById(id);
        return 1;
    }
}
